home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gwu / screen.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-30  |  1.9 KB  |  74 lines

  1. /*
  2.     GWAda Development Environment for 386/486 PCs   
  3.     Copyright (C) 1993, Arthur Vargas Lopes  & Michael Bliss Feldman
  4.                         vlopes@vortex.ufrgs.br mfeldman@seas.gwu.edu
  5.  
  6.     This program is free software; you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation; version 2 of the License.    
  9.  
  10.  
  11.     This program is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.     GNU General Public License for more details.
  15.  
  16.     You should have received a copy of the GNU General Public License
  17.     along with this program; if not, write to the Free Software
  18.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. */
  20.  
  21. /* screen.c */
  22.  
  23. #include "externs.h"
  24.  
  25.  
  26.  
  27. void AVL_FIX_SCREEN()
  28. {
  29.     AVL_EDIT_WINDOW_PTR w;
  30.     AVL_LINE_PTR l, l1;
  31.     struct rccoord old;
  32.     int i, j, r, c, c2;
  33.     short att;
  34.     old = _gettextposition();
  35.     _settextrows( 25 );
  36.     _clearscreen( _GCLEARSCREEN );
  37.     w = &avl_windows[avl_window];
  38.     l = l1 = w -> current_line;
  39.     j = old.row;
  40.     r = w -> scr_row;
  41.     c = w -> txt_col;
  42.     c2 = w -> scr_col;
  43.     while (j > 1 && l -> line_no > 0)  {
  44.         l = l -> previous;
  45.         --j;
  46.         }
  47.     w -> txt_col = 0;
  48.     for (i = 1; i <= (w -> r2 - w -> r1 + 1) && l != w -> head; ++i)  {
  49.         _settextposition(i,1);
  50.         w -> scr_row = i;
  51.         w -> current_line = l;
  52.         AVL_UPDATE_LINE();
  53.         l = l -> next;
  54.         }
  55.     w -> scr_row = r;
  56.     w -> txt_col = c;
  57.     w -> scr_col = c2;
  58.     _settextposition(old.row,old.col);
  59.     w -> current_line = l1;
  60. }        
  61.                 
  62.  
  63.  
  64. void AVL_UPDATE_SCREEN()
  65. {
  66.     short att;
  67.     att = _settextcursor(0x2000);
  68. /*   _settextwindow(w -> r1, w -> c1, w -> r2, w -> c2);
  69. */
  70.     AVL_FIX_SCREEN();
  71.     AVL_UPDATE_CURSOR();
  72.     att = _settextcursor(att);
  73. }
  74.  
  75.